package com.example.sixgod;

import android.content.Context;

import androidx.annotation.NonNull;
import androidx.room.Database;
import androidx.room.DatabaseConfiguration;
import androidx.room.InvalidationTracker;
import androidx.room.Room;
import androidx.room.RoomDatabase;
import androidx.sqlite.db.SupportSQLiteOpenHelper;

@Database(entities = {guaxiang.class}, version = 1)
public abstract class guaDatabase extends RoomDatabase {
    private static guaDatabase instance;
    public abstract guaDao guaDao();

    public synchronized static guaDatabase getInstance(Context context) {
        if (instance == null) {
            instance = Room.databaseBuilder(context, guaDatabase.class, "gua_database")
                    .allowMainThreadQueries()
                    .build();
        }
        return instance;
    }

    @NonNull
    @Override
    protected SupportSQLiteOpenHelper createOpenHelper(DatabaseConfiguration config) {
        return null;
    }

    @NonNull
    @Override
    protected InvalidationTracker createInvalidationTracker() {
        return null;
    }

    @Override
    public void clearAllTables() {

    }
}
